from time import sleep
from selenium.webdriver.common.by import By
from web.page_object.base_page import BasePage


class NewCalendarPage(BasePage):
    def create_calendar(self, calendar_title, calendar_description):
        # 解决循环导入问题
        from web.page_object.calendar_page import CalendarPage
        self.find(By.CSS_SELECTOR, '.calendar-title input').send_keys(calendar_title)
        self.find(By.CSS_SELECTOR, '.calendar-description textarea').send_keys(calendar_description)
        self.find(By.CSS_SELECTOR, '.larkc-btn').click()
        return CalendarPage(self.driver)
